package com.wmuj.mapper;

import com.wmuj.pojo.Student;
import com.wmuj.pojo.StudentQueryParam;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface StudentMapper {
  /**
   * 分页条件查询学员列表
   *
   * @param studentQueryParam
   * @return
   */
  List<Student> queryStudentsList(StudentQueryParam studentQueryParam);

  /**
   * 根据数组ids 删除学员
   *
   * @param ids
   */
  void deleteStuIds(Integer[] ids);

  /**
   * 添加学员
   *
   * @param student
   */
  void addInfo(Student student);

  /**
   * 根据id查询
   *
   * @param id
   * @return
   */
  Student findById(Integer id);

  /**
   * 修改学员
   *
   * @param student
   */
  void update(Student student);

  /**
   * 学员学历统计
   *
   * @return
   */
  @MapKey("degree") // 设置key 为 degree
  List<Map> countStudentDegreeData();

  /**
   * 班级人数统计
   *
   * @return
   */
  @MapKey("name")
  List<Map<String, Object>> countStudentCountData();
}
